<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript" src="<c:url value='js/out_erx_edatagrid.js'/>"></script>
	<script type="text/javascript" src="<c:url value='js/out_ylxm_edatagrid.js'/>"></script>
	<script type="text/javascript">
		
	</script>
	
	<div class="easyui-panel" title="门诊电子处方" 
		border="false" fit="true" >
		<form id="form_add_out_erx" action="add_out_erx" method="post">
			<table width="100%" border="0" style="padding:6px;">
				<tr>
					<td width="25%"> 
						<input name="hospWorkPatientErx.prescriptionnum" style="width:80%;" class="easyui-textbox" label="处方号*"> 
					</td>
					<td width="25%"> 

						<input id="outErx_status" name="hospWorkPatientErx.status" style="width:50%;" class="easyui-combobox" label="状态" data-options="
						readonly:'true',
						panelHeight: 'auto',
						valueField: 'label',
						textField: 'label',
						data:[{
							label:'未处理',
							selected:true
						},{
							label:'已处理'
						}]">  
					</td>
					
					<td width="25%"> 
						<input id="outErx_type" name="hospWorkPatientErx.type" style="width:60%;" class="easyui-combobox" label="处方类型" data-options="
						readonly:'true',
						panelHeight: 'auto',
						valueField: 'label',
						textField: 'label',
						data:[{
							label:'门诊处方',
							selected:true
						},{
							label:'住院处方'
						}]">  
					</td>
					<td width="25%">
						<input id="outErx_time" name="hospWorkPatientErx.time" style="width:60%;" class="easyui-datebox" label="处方时间" value="1">
					</td>
				</tr>
				<tr>
					<td width="25%"> 
						<input id="registration_id" name="hospWorkPatientErx.patientRegistrationId" style="width:70%;" class="easyui-textbox" label="门诊号"> 
						
						
						<a class="easyui-linkbutton" iconCls="icon-add" onclick="createOutPatientsQueryWindow()"></a>
						
						
					</td>
					<td width="25%">
						<input name="" style="width:70%;" class="easyui-textbox" label="住院号" data-options="readonly:true">
						<!-- <a class="easyui-linkbutton" iconCls="icon-add"></a> -->
					</td>
					<td width="25%"> 
						<input id="outErx_do" name="hospWorkPatientErx.doctorAdviceDo" style="width:50%;" class="easyui-combobox" label="医嘱执行" data-options="
						panelHeight: 'auto',
						valueField: 'label',
						textField: 'label',
						data:[{
							label:'N',
							selected:true
						},{
							label:'Y'
						}]"> 
					</td>
					<td width="25%">
						<input id="out_office" name="hospWorkPatientErx.officeName" style="width:50%;" class="easyui-combobox" label="科室*" data-options="
						panelHeight: 'auto',
						valueField: 'label',
						textField: 'label',
						data:[{
							label:'门诊',
							selected:true
						},{
							label:'住院'
						},{
							label:'内科'
						},{
							label:'外科'
						},{
							label:'儿科'
						},{
							label:'妇科'
						},{
							label:'骨科'
						},{
							label:'眼科'
						}]"> 
						<!-- <a class="easyui-linkbutton" iconCls="icon-add"></a> -->
					</td>
				</tr>
				<tr>
					<td width="25%"> 
						<input id="patient_name" name="hospWorkPatientErx.patientName" style="width:70%;" class="easyui-textbox" label="病人姓名*"> 
					</td>
					<td width="25%">
						<input id="patient_sex" name="hospWorkPatientErx.patientSex" style="width:40%;" class="easyui-combobox" label="病人性别*" data-options="
						panelHeight: 'auto',
						valueField: 'label',
						textField: 'label',
						data:[{
							label:'男',
							selected:true
						},{
							label:'女'
						}]"> 
					</td>
					<td width="25%"> 
						<input id="patient_age" name="hospWorkPatientErx.patientAge" style="width:50%;" class="easyui-textbox" label="年龄*"> 
					</td>
					<td width="25%">
						<input name="hospWorkPatientErx.doctorName" style="width:60%;" class="easyui-textbox" label="处方医生*">
					</td>
				</tr>
			</table>
			
			<div class="easyui-tabs" border="false" style="width:100%;">
				<div title="处方开药">
					<div id="out_cfky">
						<table width="100%" border="0" style="padding:6px;">
							<tr>
								<td width="25%">
									<input id="out_drugs_name" style="width:80%;" class="easyui-textbox" label="药品*"/> 
									<a class="easyui-linkbutton" iconCls="icon-add" onclick="openChargeProjectWindowFromOuterx()"></a>
								</td>
								<td width="25%" colspan="2">
									<input id="out_drugs_use" style="width:90%;" class="easyui-textbox" label="用法用量："/>
								</td>
								<td width="25%">
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="append({})">加入</a>
								</td>
							</tr>
							<tr>
								<td width="25%">
									<input id="out_drugs_num" style="width: 40%;"  class="easyui-numberspinner"  
									value="1" prompt="数量：" label="数量：" data-options="increment:1,
									onSpinUp:countSum,onSpinDown:countSum">
								</td>
								<td width="25%">
									<input id="out_drugs_price" style="width:70%;" class="easyui-textbox" label="单价：" data-options="readonly:true">
								</td>
								<td width="25%">
									<input id="out_drugs_sum" style="width:70%;" class="easyui-textbox" label="金额：" data-options="readonly:true" value="0">
								</td> 
								<td width="25%">
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="removeit()">删除</a>
								</td>
							</tr>
						</table>
					</div>
					<table style="width:100%;"  id="out_erx_dg" class="easyui-datagrid "  data-options="
						singleSelect: true,
						fitColumns: true, nowrap: false,
						rownumbers: true, toolbar: '#out_cfky',
						border: false
					">
						<thead>
							<tr>
								<th style="width:10%;" data-options="field:'out_drugs_type', editor: {type: 'textbox'}">药品类型</th>
								<th style="width:10%;" data-options="field:'out_drugs_id', editor: {type: 'textbox'}">药品编号</th>
								<th style="width:10%;" data-options="field:'out_drugs_name', editor: {type: 'textbox'}">药品名称</th>
								<th style="width:10%;" data-options="field:'out_drugs_num', editor: {type: 'textbox'}">数量</th>
								<th style="width:10%;" data-options="field:'out_drugs_sum', editor: {type: 'textbox'}">金额</th>
								<th style="width:10%;" data-options="field:'out_drugs_unit', editor: {type: 'textbox'}">单位</th>
								<th style="width:10%;" data-options="field:'out_drugs_price', editor: {type: 'textbox'}">单价</th>
								<th style="width:30%;" data-options="field:'out_drugs_use', editor: {type: 'textbox'}">用法用量</th>
								
							</tr>
						</thead>
						
						<tbody>
						</tbody>
					</table>
					
				</div>
				<div title="医疗项目">
					<div id="out_ylxm">
						<table width="100%" border="0" style="padding:6px;">
							<tr>
								<td width="33%">
									<input id="out_project_name" style="width:60%;" class="easyui-textbox" label="项目*"/> 
									<a class="easyui-linkbutton" iconCls="icon-add" onclick="openProjectWindowFromOutProject()"></a>
								</td>
								<td width="34%">
									<input id="out_project_num" style="width: 40%;"  class="easyui-numberspinner"  
									value="1" prompt="数量：" label="数量：" data-options="increment:1,
									onSpinUp:countOutProjectSum,onSpinDown:countOutProjectSum">
								</td>
								<td width="33%">
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="add({})">加入</a>
								</td>
							</tr>
							<tr>
								<td width="33%">
									<input id="out_project_price" style="width:40%;" class="easyui-textbox" label="单价：" data-options="readonly:true">
								</td>
								<td width="34%">
									<input id="out_project_sum" style="width:40%;" class="easyui-textbox" label="金额：" data-options="readonly:true" value="0">
								<td width="33%">
									<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="shanChu()">删除</a>
								</td>
							</tr>
						</table>
					</div>
					<table style="width:100%;" id="out_ylxm_dg" class="easyui-datagrid" data-options="
						singleSelect: true,
						fitColumns: true, nowrap: false,
						rownumbers: true, toolbar: '#out_ylxm',
						border: false
					">
						<thead>
							<tr>
								<th style="width:15%;" data-options="field:'out_project_type', editor: {type: 'textbox'}">收费类型</th>
								<th style="width:15%;" data-options="field:'out_project_id', editor: {type: 'textbox'}">收费项目编号</th>
								<th style="width:20%;" data-options="field:'out_project_name', editor: {type: 'textbox'}">收费项目名称</th>
								<th style="width:15%;" data-options="field:'out_project_num', editor: {type: 'textbox'}">数量</th>
								<th style="width:20%;" data-options="field:'out_project_sum', editor: {type: 'textbox'}">金额</th>
								<th style="width:15%;" data-options="field:'out_project_price', editor: {type: 'textbox'}">单价</th>
							</tr>
						</thead>
						
						<tbody>
						</tbody>
					</table>
					
				</div>
				
				<div title="诊断医嘱">
					<table width="100%" border="0" style="padding:6px;">
						<tr>
							<td width="33%"> 
								<input name="patientDoctorAdvice.diagnosis" style="width:70%;" class="easyui-textbox" label="诊断：">
							</td>
							<td width="33%">
								<input id="out_doctor_status" name="patientDoctorAdvice.doctorStatus" style="width:40%;" class="easyui-combobox" label="医嘱状态：" data-options="
									panelHeight: 'auto',
									valueField: 'label',
									textField: 'label',
									data:[{
										label:'长期医嘱'
									},{
										label:'短期遗嘱',
										selected:true
									}]">  
							</td>
							<td width="33%">
								<input name="patientDoctorAdvice.doctorStatus" style="width:40%;" class="easyui-combobox" label="医嘱状态：" data-options="
									panelHeight: 'auto',
									valueField: 'label',
									textField: 'label',
									data:[{
										label:'正常',
										selected:true
									},{
										label:'停用',
									}]">  
							</td>
						</tr>
						<tr>
							<td colspan="3">
								<input name="patientDoctorAdvice.doctorAdvice" style="width:80%;height:300px;" class="easyui-textbox" label="医嘱："
									data-options="
									multiline:true
									"> 
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div style="margin-left:7px">
				<input name="hospWorkPatientErx.outTotal" id="out_total" style="width:200px;" class="easyui-textbox" label="处方金额：" data-options="readonly:true" value="0"> 元
			</div>
			
		</form>	
		<div style="margin: 8px 3px;">
			<a onclick="saveOutErx()" class="easyui-linkbutton" iconCls="icon-save">保存</a>
		</div>
		</div>
		<!-- 收费项目窗口 -->
		<div id="chargeProjectWindow" class="easyui-window" title="收费项目"
			data-options="collapsible:false,minimizable:false,maximizable:true,
			modal:true,iconCls:'icon-search',closed:true,href:'to_hspt_live_chargeProject'"
			style="width: 70%; height: 80%; padding: 2px;">
		</div>
	</div>
</body>
</html>